package testCase.module1;

import com.robotium.solo.By;

import android.util.Log;
import testCase.HeadTestCase;
import utils.MyTestResult;

public class NO_003_LoadAgreement extends HeadTestCase {

	MyTestResult t = new MyTestResult();

	public NO_003_LoadAgreement() {
		try {
			super.setUp();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	// 检查用户协议
	public void test_001_UserAgreementWeb() throws Exception {
		Log.d(TAG, "waitforActivity:" + solo.waitForActivity("LoginActivity"));
		entrance.getStart_Page().click_tv_agreement();
		solo.sleep(1000);
		if (solo.waitForView(entrance.getStart_Page().getWebview())
				&& solo.waitForWebElement(By.cssSelector("#main_container > h2"),10000,false)
				&& solo.getWebElement(By.cssSelector("#main_container > h2"), 0).getText().equals("欢迎使用一起教服务（以下简称“服务”）")) {
			
			Log.d(TAG, "成功加载用户协议网页");
			t.printTestResultToExcel(cl_Name + getName(), "检查用户协议是否加载成功", "成功", "pass");
			
		} else {
			Log.e(TAG, "加载用户协议网页失败");
			t.printTestResultToExcel(cl_Name + getName(), "检查用户协议是否加载成功", "成功", "pass");
			assertTrue(false);
		}
		Log.d(TAG, "weburl:" + solo.getWebUrl());
	}
}
